#
#  Makefile for Horizon
#
#  Francesco Frigo
#  Sunday 27th August, 2006
#
#  Updated on: Sunday 27th August, 2006
#

include ../../config.mak


INCLUDEDIR = -I../../include -I../../lib/include -I./include


SRCS_CC := $(wildcard *.c)
SRCS_AS := $(wildcard *.s)

OBJS_CC := $(patsubst %.c, %.o, $(SRCS_CC))
OBJS_AS := $(patsubst %.s, %.o, $(SRCS_AS))

SRCS := $(SRCS_CC) $(SRCS_AS)
OBJS := $(OBJS_CC) $(OBJS_AS)


all: $(OBJS)

%.o: %.c
	$(CC) -c $(CFLAGS) $(INCLUDEDIR) -o $@ $<

%.o: %.s
	$(AS) -o $@ $<

clean: objremove
	rm -f *~

objremove:
	rm -f *.o

distclean:
	rm -f .depend

depend .depend:
	$(CC) -MM $(CFLAGS) $(INCLUDEDIR) *.c 1>.depend

.PHONY: all clean objremove distclean depend

include .depend
